function strModel(str) {
  let reg = /\[(.+?)\]/g;
  str = str.replace(reg, function (x, y) {
    console.log(x, y)
    console.log(arguments)
    return '<span class=""text-highlight>' + y + '</span>'
  })
  return str;
}

let name = '长城软件',
  age = 40;
let str = "[DiLink2.0]智能网联系统/10.1英寸[8核]自适应旋转悬浮 Pad";


console.log(strModel(str))